<template>
	<uni-nav-bar title="打卡详情" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
	<view class="package_sale">{{title}}</view>
	<view class="package_sale" v-for="item in workList" :key="item.id">
		<view>{{item.remarks?item.remarks:'--'}}</view>
		<image :src="item.image" mode=""></image>
		<view>{{item.createtime}}</view>
	</view>
</template>

<script setup lang="ts">
	import { navBack, navTo } from '@/utils/navigator';
	import { ref } from 'vue';
	import { onLoad } from '@dcloudio/uni-app';
	import { showLoading } from '@/utils/prompt';
	import { getBanClockList } from '@/gql/earthPushing/checkWork';
	import { toPublish } from '@mqtt';
	const banID = ref()
	const workList = ref([])
	const title = ref('')
	onLoad((pearm) => {
		title.value = pearm.title
		banID.value = Number(pearm.id)
		init()
	})
	function init() {
		showLoading()
		const payload = {
			query: getBanClockList,
			variables: {
				ban_id: banID.value
			},
		};
		toPublish('ql/staff/getBanClockList',
			payload,
			(obj : any) => {
				uni.hideLoading();
				const { getBanClockList } = obj.data;
				workList.value = getBanClockList
			},
		);
	}
</script>

<style scoped lang="less">
	image {
		width: 200rpx;
		height: 200rpx;
		border-radius: 5px;
		margin: 20rpx 0px;
	}
</style>